Part Number Hot Search : 
2005G C0201 Q6511 SB1182 M48Z59Y AC161A 6672A R3002
Product Description
Full Text Search
 

To Download AN1127 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  AN1127/1199 1/3 application note using the st62t6xc/5xc spi in master mode by microcontroller application team 1 introduction to avoid problems when switching from rev b to rev c devices, special attention must be paid to the programming of the i/o port data direction register when using the spi in master mode. in rev b devices, the spi functions in master mode without depending on whether the ddr bit for the i/o port pin (pc4) used for the sck is set or reset (programmed as input or output). in rev c devices, the ddr bit has to be programmed as input (left at the reset value). 2 functional description when the spi is used in master mode, the sck pin (pc4) and sout pin (pc3) work in output mode and sin pin (in input mode). to enable the spi in master mode, the spclk bit of the spi mode control register has to be set. by setting this bit, the sck pin (pc4) is automatically configured in output push pull mode and the clock appears according to the base/bit clock selection. the dedicated bit of the port c data direction register has to remain in its reset state (input mode); its configuration doesn't have to be changed. the output of the spi data register (sout/pc3) is also automatically configured in output push pull by setting bit 0 of the miscr register. the input of the spi data register (sin/pc2) can be configured in input with or without pull-up. 1
2/3 using the st62t6xc/5xc spi in master mode 3 example the following is a software example for spi in master mode: .org 080h reset clr x clr a ldi wdr,watchtim ; load the watchdog. ldi ocr, 00h ; set oscillator division to 1 ldi ddrc,00h ldi orc,00h ldi drc,00h ; reset state ldi drc,004h ; pc2 in input without p-u ldi misc,001h ; pc3 in output push pull ldi spidiv,048h ; 9 bits ldi spimod,03eh ; pc4 in out p/p cpol=0 cpha=1 spin=0 ldi spidr,0aah set 7,spimod ; spirun loop jrs 7,spimod,loop ; poll end of transmission 2
3/3 using the st62t6xc/5xc spi in master mode "the present note which is for guidance only aims at providing customers with information regarding their products in order for them to save time. as a result, stmicroelectronics shall not be held liable for any direct, indirect or consequential damages with respect to any claims arising from the content of such a note and/or the use made by customers of the information contained herein in connexion with their products." information furnished is believed to be accurate and reliable. however, stmicroelectronics assumes no responsibility for the co nsequences of use of such information nor for any infringement of patents or other rights of third parties which may result from its use. no license is granted by implication or otherwise under any patent or patent rights of stmicroelectronics. specifications mentioned in this publicati on are subject to change without notice. this publication supersedes and replaces all information previously supplied. stmicroelectronics prod ucts are not authorized for use as critical components in life support devices or systems without the express written approval of stmicroele ctronics. the st logo is a registered trademark of stmicroelectronics ? 1999 stmicroelectronics - all rights reserved. purchase of i 2 c components by stmicroelectronics conveys a license under the philips i 2 c patent. rights to use these components in an i 2 c system is granted provided that the system conforms to the i 2 c standard specification as defined by philips. stmicroelectronics group of companies australia - brazil - canada - china - france - germany - italy - japan - korea - malaysia - malta - mexico - morocco - the neth erlands - singapore - spain - sweden - switzerland - taiwan - thailand - united kingdom - u.s.a. http://www.st.com


▲Up To Search▲   

 
Price & Availability of AN1127

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X